﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Diplomova_prace
{
    class StackShunting
    {
        List<NodeShunting> zasobnik = new List<NodeShunting>();
        public void Push(string znak, int priorita)
        {
            zasobnik.Insert(0, new NodeShunting(znak, priorita));
        }
        public void Pop()
        {
            zasobnik.RemoveAt(0);
        }
        public int getCount
        {
            get { return zasobnik.Count; }
        }
        public int getprioritaTop
        {
            get
            {
                if (zasobnik.Count == 0)
                    return -1;
                else
                    return zasobnik[0].priority;
            }
        }
        public string getznakTop
        {
            get
            {
                if (zasobnik.Count == 0)
                    return " ";
                else
                    return zasobnik[0].character.ToString();
            }
        }
    }
    class Stack
    {
        List<Node> zasobnik = new List<Node>();
        public void Push(double znak, int priorita)
        {
            zasobnik.Insert(0, new Node(znak, priorita));
        }
        public void Pop()
        {
            zasobnik.RemoveAt(0);
        }
        public int getCount
        {
            get { return zasobnik.Count; }
        }
        public int getprioritaTop
        {
            get
            {
                if (zasobnik.Count == 0)
                    return -1;
                else
                    return zasobnik[0].priority;
            }
        }
        public double getznakTop
        {
            get
            {
                if (zasobnik.Count == 0)
                    return double.NaN;
                else
                    return zasobnik[0].character;
            }
        }
    }
}
